var isIE6=false;
function checkIE6(){
	$("body").append("<div id='tmpTESTie6'>&nbsp;</div>");
	$("#tmpTESTie6").css({height:"1px"});
	isIE6=$("#tmpTESTie6").height()!=1;
	$("#tmpTESTie6").remove();
}

$(document).ready(function(){
	checkIE6();
		
	var leftAreaH=$("#leftArea").height();
	var mainAreaH=$("#mainArea").height();
	if(leftAreaH<=mainAreaH){
		$("#leftArea").height(mainAreaH);
	}else{
		$("#mainArea").height(leftAreaH);
	}
	
	$("#breadCrumb li:first-child").addClass("first");
	$("#breadCrumb li:last-child").addClass("last");
	
	$("#footer #footerLinks ul li:first-child").addClass("first");
	
	$("#listTable").each(function(i){
		$(this).find("th:first-child").addClass("first");
		$(this).find("td:first-child").addClass("first");
		$(this).find("tr:has(td):odd").addClass("odd");
		$(this).find("tr:has(td):even").addClass("even");
	});
	
	$("#reportForm").each(function(i){
		$(this).find("th:first-child").addClass("first");
		$(this).find("td:first-child").addClass("first");
		$(this).find("tr:has(td):odd").addClass("odd");
		$(this).find("tr:has(td):even").addClass("even");
	});

	
	
	
});

function divPrint(divId)
{
	var content_vlue = document.getElementById(divId).innerHTML;
	
	if (null == content_vlue || content_vlue.length == 0)
		return;
	
	var width  = 800;
	var height = 600;
	if (window.screen) {
		width = window.screen.availWidth;
		height = window.screen.availHeight;
	}
	
	var left   = (screen.width  - width)/2;
	var top    = (screen.height - height)/2;
	var params = 'width='+width+', height='+height;
	params += ', top='+top+', left='+left;
	params += ', directories=no';
	params += ', location=no';
	params += ', menubar=no';
	params += ', resizable=no';
	params += ', scrollbars=yes';
	params += ', status=no';
	params += ', toolbar=yes';
	params += ', fullscreen=no';
	
	
	var docprint=window.open("","", params);
	docprint.document.open();
	docprint.document.write('<html><head><title>遠東商銀 全方位企業收款服務</title>');
	docprint.document.write('<link rel="stylesheet" type="text/css" media="all" href="styles/default/style.css"/>');
	docprint.document.write('<link rel="stylesheet" type="text/css" media="all" href="styles/default/jquery-ui-1.8.6.custom.css"/>');
	docprint.document.write('</head><body onLoad="self.print()"><center>');
	docprint.document.write(content_vlue);
	docprint.document.write('</center></body></html>');
	docprint.document.close();
	docprint.focus(); 
}

function verifyEmail(email)
{
	if(email!=""){
		data = email.match(/^\S+@\S+\.\S+$/);
		if (!data) {
			return false;
		}
	}
		return true;
}


if (window.location.protocol == "http:") {
    var restOfUrl = window.location.href.substr(5);
    //window.location = "https:" + restOfUrl;
}

